home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / AlertContentView.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1017 b   |  39 lines  |  [TEXT/CWIE]

  1. // AlertContentView.java
  2. // By Ned Etcode
  3. // Copyright 1995, 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. import netscape.util.*;
  8.  
  9. /** Alert private class.
  10.   */
  11.  
  12. class AlertContentView extends View implements Target {
  13.     Alert alert;
  14.  
  15.     public AlertContentView(Alert anAlert,int x, int y, int w, int h) {
  16.         super(x,y,w,h);
  17.         alert = anAlert;
  18.     }
  19.  
  20.     public void drawView(Graphics g) {
  21.         g.setColor(Color.lightGray);
  22.         g.fillRect(g.clipRect());
  23.     }
  24.  
  25.     public void performCommand(String command, Object data) {
  26.         if (Alert.DEFAULT_ACTION.equals(command))
  27.             alert.setResult(Alert.DEFAULT_OPTION);
  28.         else if (Alert.SECOND_ACTION.equals(command))
  29.             alert.setResult(Alert.SECOND_OPTION);
  30.         else if (Alert.THIRD_ACTION.equals(command))
  31.             alert.setResult(Alert.THIRD_OPTION);
  32.         else
  33.             throw new NoSuchMethodError("unknown command: " + command);
  34.  
  35.         alert.hide();
  36.     }
  37. }
  38.  
  39.